package org.qiuqiu.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class LocalIPUtils {
	//获取本地的IP地址
	public static String getLocalIP() {
		InetAddress inetAddress = null;
		try {
			inetAddress=InetAddress.getLocalHost();
			
		String ip=inetAddress.toString();
	      return ip.split("/")[1];
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
		return null;
	}
}
